package com.swx.identityservice.webapis;

import com.swx.identityservice.models.ScbpHandleBusiness;
import com.swx.identityservice.service.ScbpHandleBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author LC
 * @version V1.0.0
 * @date 2018-5-25 10:31
 */
@Slf4j
@Api(tags = "办理业务控制器")
@RestController
public class ScbpHandleBusinessController {

    @Autowired
    private ScbpHandleBusinessService mappingService;

    private ModelMapper modelMapper;

    public ScbpHandleBusinessController() {
        modelMapper = new ModelMapper();
    }

    @ApiOperation("获取办理业务列表")
    @GetMapping(value = "/gethandlebusinessservice")
    public List<ScbpHandleBusiness> getDeptsAsTree() throws Exception {
        return mappingService.getDeptsAsTree(0);
    }
}
